// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.ai.states;

import zombie.ai.State;
import zombie.characters.IsoGameCharacter;
import zombie.characters.IsoPlayer;
import zombie.network.GameServer;

public final class PlayerOnGroundState extends State {
    private static final PlayerOnGroundState _instance = new PlayerOnGroundState();

    public static PlayerOnGroundState instance() {
        return _instance;
    }

    @Override
    public void enter(IsoGameCharacter owner) {
        owner.setIgnoreMovement(true);
        ((IsoPlayer)owner).setBlockMovement(true);
        owner.setVariable("bAnimEnd", false);
    }

    @Override
    public void execute(IsoGameCharacter owner) {
        if (!GameServer.bServer && owner.isDead()) {
            owner.die();
        } else {
            owner.setReanimateTimer(owner.getReanimateTimer() - zombie.GameTime.getInstance().getMultiplier() / 1.6F);
        }
    }

    @Override
    public void exit(IsoGameCharacter owner) {
        owner.setIgnoreMovement(false);
        ((IsoPlayer)owner).setBlockMovement(false);
    }
}
